<template>
	<view class="page">
		<view class="comment">
			<textarea placeholder="请输入评价内容..." v-model="content" maxlength="500"/>
		</view>
		<view class="btn-box">
			<u-button shape="circle" type="primary" @click="post">提交</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				content:''
			}
		},
		methods: {
			post(){
				if(!this.content){this.$u.toast('请输入评价内容');return;}
				this.$u.post('/api/user/complaint',{
					status:1,
					admin_housekeeper_id:this.id,
					content:this.content
				}).then(res=>{
					uni.showModal({
						showCancel:!1,
						content:'提交成功',
						success: () => {
							this.$app.back()
						}
					})
				})
			}
		},
		onLoad({id}) {
			this.id = id
		}
	}
</script>

<style lang="scss">
	.page{
		padding: 40rpx;
		.comment{border: 2rpx solid #ddd;padding: 20rpx;height: 400rpx;border-radius: 20rpx;
			textarea{width: 100%;height: 100%;box-sizing: border-box;}
		}
		.btn-box{padding: 50rpx 0 0;}
	}
</style>
